#ifndef __OLED_H
#define __OLED_H

#include "stm32f1xx_hal.h"

// OLED硬件定义
#define OLED_I2C hi2c1
#define OLED_ADDRESS 0x78  // SSD1306 I2C地址
#define OLED_WIDTH 128
#define OLED_HEIGHT 64

// 外部I2C句柄声明
extern I2C_HandleTypeDef hi2c1;

// 函数声明
void OLED_Init(void);
void OLED_WriteCommand(uint8_t cmd);
void OLED_WriteData(uint8_t data);
void OLED_Clear(void);
void OLED_SetCursor(uint8_t x, uint8_t y);
void OLED_ShowString(uint8_t x, uint8_t y, char *str);
void OLED_ShowChar(uint8_t x, uint8_t y, char chr);
void OLED_ShowNumber(uint8_t x, uint8_t y, uint32_t num);
void OLED_ShowFloat(uint8_t x, uint8_t y, float num, uint8_t decimal_places);

#endif /* __OLED_H */